#scrollToTopBtn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999; /* z-index değeri artırıldı */
    border: none;
    outline: none;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    padding: 15px;
    border-radius: 50%;
    font-size: 18px;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.9);
}

#scrollToTopBtn:hover {
    background-color: var(--secondary-color);
    transform: scale(1.1);
}

#scrollToTopBtn:active {
    transform: scale(0.95);
}

#scrollToTopBtn.show {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

@keyframes fadeInOut {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.btn-animation {
    animation: fadeInOut 0.3s ease-in-out;
}


/* Mobil görünüm için pozisyon ayarı */
@media screen and (max-width: 768px) {
    #scrollToTopBtn {
        right: auto;
        left: 2vw; /* Viewport width kullanıldı */
        position: fixed !important;
        transform: translateX(0) scale(0.9); /* X ekseninde transform sıfırlandı */
        will-change: transform; /* Performans optimizasyonu */
    }

    #scrollToTopBtn.show {
        transform: translateX(0) scale(1);
    }

    #scrollToTopBtn:hover {
        transform: translateX(0) scale(1.1);
    }

    #scrollToTopBtn:active {
        transform: translateX(0) scale(0.95);
    }
}